<template>
  <!-- 变更信息 -->
  <div id="detail">
    <el-form :model="form" label-width="100">
      <el-form-item label="合同编号:" @click="toContractDetail">
        <p class="click">{{ form.num }}</p>
      </el-form-item>
      <el-form-item label="变更名称:">
        <p>{{ form.name }}</p>
      </el-form-item>
      <el-form-item label="变更版本:">
        <p>{{ form.changeVersion }}</p>
      </el-form-item>
      <el-form-item label="变更理由:" style="width: 100%">
        <p>{{ form.changeReason }}</p>
      </el-form-item>
      <el-form-item label="申请变更时间:">
        <p>{{ form.createTime }}</p>
      </el-form-item>
      <el-form-item label="审核状态:" v-if="isReloadData" style="width: 100%">
        <p v-if="form.status == 0" style="color: #e6a23c">待审核</p>
        <p v-if="form.status == 1" style="color: #67c23a">通过</p>
        <p v-if="form.status == 2" style="color: #f56c6c">未通过</p>
        <p v-if="form.status == 3" style="color: #ff9b31">审核中</p>
      </el-form-item>
    </el-form>
  </div>
</template>
<script>

export default {
  name: 'detail',
  data () {
    return {
      // form: {},
      isReloadData: true//局部刷新标识
    }
  },
  props: {
    form: {
      type: Object,
      required: true,
      default: () => {
        return {}
      }
    }
  },
  methods: {
    toContractDetail () {
      this.$router.push({
        path: '/contract/contractManagement/contractDetail',
        query: {
          id: this.form.contractId
        }
      })
    },
    relodPart () {
      this.isReloadData = false
      this.$nextTick(() => {
        this.isReloadData = true
      })
    }
  }
}
</script>
<style lang='scss' scoped>
.click {
  cursor: pointer;
}
</style>